x86/vmx: implement VMExit based guest Bus Lock detection
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 21 Mar 2023 12:40:41 +0000 (13:40 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 21 Mar 2023 12:40:41 +0000 (13:40 +0100)
commit83f12e4eafdc4b034501adf4847a09a1293fdf8b
treef00545cc6e4f793d69703c0753c598db998b41ee
parenta730e4d1190594102784222f76a984d10bbc88a9
x86/vmx: implement VMExit based guest Bus Lock detection

Add support for enabling guest Bus Lock Detection on Intel systems.
Such detection works by triggering a vmexit, which ought to be enough
of a pause to prevent a guest from abusing of the Bus Lock.

Add an extra Xen perf counter to track the number of Bus Locks detected.
This is done because Bus Locks can also be reported by setting the bit
26 in the exit reason field, so also account for those.

Note EXIT_REASON_BUS_LOCK VMExits will always have bit 26 set in
exit_reason, and hence the performance counter doesn't need to be
increased for EXIT_REASON_BUS_LOCK handling.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
master commit: f7d07619d2ae0382e2922e287fbfbb27722f3f0b
master date: 2022-12-19 11:22:43 +0100
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vvmx.c
xen/arch/x86/include/asm/hvm/vmx/vmcs.h
xen/arch/x86/include/asm/hvm/vmx/vmx.h
xen/arch/x86/include/asm/perfc_defn.h